home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2923 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  819 b 

  1. Path: news.jmu.edu!warrenrk
  2. From: warrenrk@falcon.jmu.edu (Rachel K. Warren)
  3. Newsgroups: comp.lang.c
  4. Subject: Adding Arrays, anyone?
  5. Date: 24 Jan 1996 23:53:26 GMT
  6. Organization: James Madison University, Harrisonburg, VA
  7. Sender: warrenrk@jmu.edu
  8. Message-ID: <4e6gpm$dfb@doc.jmu.edu>
  9. NNTP-Posting-Host: falcon.jmu.edu
  10. X-Newsreader: TIN [version 1.2 PL2 JMU4]
  11.  
  12. Could somebody give me an example of adding two arrays together?
  13. Say the first array has four mailboxes with "1" in it to, so when you 
  14. print it out its,"1111" and the second array has four mailboxes with the 
  15. number "2" in it, so that you print it out and its "2222", so I could get 
  16. "3333"?
  17.  
  18.  
  19. I tried something like
  20.  
  21. for(counter =0 ; counter != '\0'; counter++)
  22.  printf("%c",string1[counter] + string2[counter]
  23.  
  24. and I got a bunch of garbage on the screen.
  25.  
  26.  
  27.